package cc.iotkit.system.controller;

import cc.iotkit.common.api.Request;
import cc.iotkit.common.web.core.BaseController;
import cc.iotkit.model.bas.BasAreaRecord;
import cc.iotkit.system.service.IBasAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/bas/area")
@Api(tags = "地区信息")
public class BasAreaController extends BaseController {
    @Autowired
    private IBasAreaService basAreaService;

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/list")
    public List<BasAreaRecord> list(@Validated @RequestBody Request<BasAreaRecord> query) {
        return basAreaService.getList(query.getData());
    }
}
